package com.lifl.ecogarde;

import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;

public class ConsulterActivity extends AjoutActivity {
	private final String TAG = "ConsulterActivity";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.consulter);
		setTitle("EcoGarde > Consulter une observation");

		if (!getIntent().getExtras().isEmpty()) {
			Bundle extras = getIntent().getExtras();
			saveContextWithinNextHTTPClientCall(extras);
		}

	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {

		Log.d(TAG, "debut keydown");

		// if(keyCode == KeyEvent.KEYCODE_BACK){

		Bundle extras = new Bundle();
		extras.putSerializable("SerializableCookieStore", getIntent()
				.getExtras().getSerializable("SerializableCookieStore"));
		goBack(extras, EcoGardeActivity.class);
		this.finish();

		// }
		Log.d(TAG, "fin keydown");
		return true;
	}

}
